package org.example.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.pojo.Good;
import org.example.pojo.Result;
import org.example.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@Tag(name = "订单管理", description = "订单管理")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("order")
    @Operation(summary = "创建订单", description = "创建订单")
    public Result order(@RequestBody Good good){
        return orderService.createOrder(good.getId());
    }
}
